#!/bin/bash

mkdosfs -v -C -n "volume 1" -s 1 -f 2 -F 32 -i 12345 -r 17 -S 512 test.fat 1024
mount -t msdos -o loop ./test.fat ./mountdir
cd mountdir
mkdir foo
cd foo
cp ../../vfat.py .
cp ../../autofuncs.py .
cp ../../vfat.py xxx.yyy
cp ../../vfat.py yyy.xxx
rm xxx.yyy
cp ../../vfat.pyc .
cd ../../
umount ./test.fat
fsck.msdos -n -l -v -V test.fat
python vfat.py <<EOF
load test.fat
show-boot
show-fat
show-root
set-dir foo
dir
make-file xyz.xyz vfat.py
make-file xyz.xys vfat.py
save
quit
EOF
fsck.msdos -n -l -v -V test.fat
mount -t msdos -o loop ./test.fat ./mountdir
ls -lR mountdir
diff mountdir/foo/xyz.xys ./vfat.py
